// ==UserScript==
// @name         车辆看板2 走行部跳转脚本
// @namespace    none
// @version      0.8
// @description  走行部跳转脚本
// @author       Rainbow
// @match        *://172.20.50.11/static/shmetro-rise-ui/*
// @run-at       document-idle
// ==/UserScript==

(function() {
    'use strict';
    // Your code here...
    console.log('Rainbow script Of train2')
    let username = '01010011334'
    let pwd = 'Sh0299123!@#'
    //填写用户名
    // let usernameInput = document.querySelector(pathOfusernameInput)
    // usernameInput.value = username
    // //填写密码
    // let pwdInput = document.querySelector(pathOfpwdInput)
    // pwdInput.value = pwd
    //点击登陆
    //document.querySelector(pathOfBtn).click()
    //simLogin()
    checkMod()
    function checkMod()
    {
        let mod = localStorage.getItem('tm_mod')
        if(mod)
        {
            if(mod == 2)
            {
                window.location.href = 'http://172.20.50.11/cgdm450/singleLoginOnNew?auth_type=2'
            }
        }
    }

    function GetQueryString(name) { 
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); 
        var r = window.location.search.substr(1).match(reg);  //获取url中"?"符后的字符串并正则匹配
        var context = ""; 
        if (r != null) 
             context = r[2]; 
        reg = null; 
        r = null; 
        return context == null || context == "" || context == "undefined" ? "" : context; 
    }
})();